package gos10i

import (
	"fmt"
	"time"
)

// XChinaMonth 返回日期的『n月』
//
// day 日期
//
func XChinaMonth(day time.Time) string {
	switch day.Month() {
	case time.January:
		return fmt.Sprintf("%s月", "一")
	case time.February:
		return fmt.Sprintf("%s月", "二")
	case time.March:
		return fmt.Sprintf("%s月", "三")
	case time.April:
		return fmt.Sprintf("%s月", "四")
	case time.May:
		return fmt.Sprintf("%s月", "五")
	case time.June:
		return fmt.Sprintf("%s月", "六")
	case time.July:
		return fmt.Sprintf("%s月", "七")
	case time.August:
		return fmt.Sprintf("%s月", "八")
	case time.September:
		return fmt.Sprintf("%s月", "九")
	case time.October:
		return fmt.Sprintf("%s月", "十")
	case time.November:
		return fmt.Sprintf("%s月", "十一")
	case time.December:
		return fmt.Sprintf("%s月", "十二")
	default:
		return "错误时间格式"
	}
}

// XChinaWeekday 返回日期的『周n』或『星期n』
//
// prefix 前缀,周|星期
//
// day 日期
//
func XChinaWeekday(prefix string, day time.Time) string {
	switch day.Weekday() {
	case time.Sunday:
		return fmt.Sprintf("%s%s", prefix, "日")
	case time.Monday:
		return fmt.Sprintf("%s%s", prefix, "一")
	case time.Tuesday:
		return fmt.Sprintf("%s%s", prefix, "二")
	case time.Wednesday:
		return fmt.Sprintf("%s%s", prefix, "三")
	case time.Thursday:
		return fmt.Sprintf("%s%s", prefix, "四")
	case time.Friday:
		return fmt.Sprintf("%s%s", prefix, "五")
	case time.Saturday:
		return fmt.Sprintf("%s%s", prefix, "六")
	default:
		return "错误时间格式"
	}
}
